home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / d86.arc / MEMORY.DOC < prev    next >
Encoding:
Text File  |  1986-08-20  |  16.4 KB  |  320 lines

  1. ---MEMORY.DOC---
  2.  
  3. Memory Display Windows
  4.  
  5. The debugger allows you to set up windows into your program memory space.
  6. Using these windows, you can view memory in a variety of formats.  The windows
  7. will remain in effect until you cancel them; updating themselves automatically
  8. if the memory changes.
  9.  
  10. A memory window line consists of a specification, typed in by you, followed by
  11. a display, supplied by the debugger.
  12.  
  13. To type in a specification on any one of window lines 1 through 6, simply type
  14. the associated digit, 1 through 6, when the debugger is in its main command-
  15. mode.  The cursor will jump to the beginning of the memory-window line you are
  16. specifying.  You then type in a display-format specification, followed by the
  17. address of memory you want displayed.
  18.  
  19. The simplest form of the display-format specification is a single letter,
  20. signifying one of the display types available.  The choices are:
  21.  
  22.        B  for hexadecimal bytes
  23.        W  for hexadecimal words
  24.        N  for decimal bytes
  25.        D  for decimal words
  26.        Q  for octal bytes
  27.        O  for octal words
  28.        T  for text; each byte reduced to one ASCII display-character
  29.        A  for ASCII text, each byte occupying 2 display-characters
  30.        C  for ASCII characters, occupying 2 bytes if needed, otherwise one
  31.  
  32. A format-specification of one of the above letters will cause the debugger
  33. to display the array of bytes starting at the address you specify, in the
  34. format indicated by the letter, as long as there is room on the line.
  35. All letters in a format-specification (or in any other context in the
  36. debugger) can be typed in either upper- or lower-case.
  37.  
  38. The format-specification should be terminated by a comma.  After the comma
  39. (and an optional space), you type the address of memory you want displayed.
  40. This consists of two values, the segment followed by the offset.  The values
  41. should be separated by a comma. You can omit the segment value if you wish: in
  42. that case, the current value of DS is used. The debugger reminds you that you
  43. have specified this option by following what you type with 2 commas instead of
  44. one.
  45.  
  46. The value you type can take one of the following forms:
  47.    a. a numeric constant, whose format is just as in the assembly language
  48.       (leading zero means default hex, otherwise default decimal)
  49.    b. a register name (except IP is not recognized)
  50.    c. a user-symbol from the assembly-language program being debugged.
  51.  
  52. After you type the address-specification, you hit the ENTER key, and the
  53. debugger fills out the rest of the line with the memory display.
  54.  
  55. For example, if you want to display hex bytes starting at 01000 hex on
  56. display-line 2, you type 2b,01000<ENTER>. The cursor jumps to the line
  57. immediately when you type the 2, and it displays the b,01000 on the line
  58. as you type it.  The b says you want hex bytes, and the 01000 has a leading
  59. zero to signify a hexidecimal address, not decimal.  When you press the
  60. ENTER key, the debugger displays two commas, followed by the hex bytes.  If the
  61. memory is zeroed, you will see 00 00 00 00 00 etc. to the end of the
  62. display-line.
  63.  
  64.  
  65. Erasing Memory Display Lines
  66.  
  67. Any memory-display window that you specify will remain in effect, always
  68. updated to show the latest memory contents, until you explicitly erase it.
  69. To erase a window, you type the number of the window, followed by either
  70. a blank or the ENTER key.  The line will also be erased if you start
  71. typing a format-specification, and you hit the ENTER key before you get
  72. to your address-specification.
  73.  
  74. In the coming sections, many of the examples assume (and they say so) that
  75. your display is blank before you type in the example.  You can always get
  76. a blank display by typing in each number followed by a blank: "1 2 3 4 5 6 ".
  77.  
  78.  
  79. Continuation Lines
  80.  
  81. You may continue a memory-display window onto the next line, by placing a
  82. double-quote mark " at the beginning of the next line.  You may do this in
  83. one of two ways: you may type the number of the next line, followed by the
  84. double-quote mark; or you may simply type the double-quote mark at the command
  85. level.  The first method allows you to specify which window-line you want
  86. continued, if there is more than one.  The second method is more convenient
  87. to use.  It places the quote-mark on the last blank-line that immediately
  88. follows a non-blank line.
  89.  
  90. You may continue placing "-marks on as many lines as you have, creating a
  91. multi-line display.
  92.  
  93. The debugger follows the "-mark with the address of memory being displayed,
  94. followed by the memory, according to the start of the type-specification of
  95. the line being continued.  The memory display is aligned with the display of
  96. above line.
  97.  
  98. If you are creating a multi-line display, and your specification is a long one,
  99. you may wish to start the display at the beginning of the next line, rather
  100. than after the specification on the first line.  This will often give you more
  101. room.  You do this by terminating the format-specification with a slash /
  102. instead of a comma.  For example, to display many hex bytes at the array
  103. BYTE_ARRAY, type 1b/byte_array<ENTER>""""" when the memory-display is empty.
  104.  
  105.  
  106. Mixed Format Specification
  107.  
  108. Instead of having all your bytes or words on a line displayed in the same
  109. format, you can mix your formats.  You do this by providing more than one
  110. letter in your format-specification.  The debugger will display one memory
  111. unit for each letter-type you specify.  The line will be filled out with the
  112. last type given.  For example, if you type 3nwb,01000<ENTER>, you will get
  113. a display on memory-line 3 of the decimal byte at 01000, the hex word at
  114. 01001, and an array of hex bytes starting at 01003.
  115.  
  116.  
  117. Numbers in a Format Specification
  118.  
  119. You may precede any letter in a format specification with a number up to 255.
  120. The effect is the same as if you had repeated the letter the given number of
  121. times.  For example, if you type 1 to go to memory line 1, followed by
  122. 4w10tb,02000<ENTER>, you will get 4 hex words at 02000, 10 text characters at
  123. 02008, and an array of hex bytes from 02012 filling out the rest of the line.
  124.  
  125. You may also end your format specification with a number up to 255.  This
  126. will cause the entire specification to be repeated the given number of times.
  127. If there is room on the line for the full number given, the display will
  128. stop there-- there will be no repeating of the last type-byte.  If there is
  129. not room on the line for the full number of global iterations, the debugger
  130. will stop at the end of the last iteration that would fit.  For example, the
  131. specification b8 causes 8 hex bytes to be displayed, and the remainder of
  132. the display line to be blank.  The specification b3w9 will cause the debugger
  133. to try to output 9 records, each consisting of a hex byte followed by 3 hex
  134. words.  After putting out 2 such records, the debugger will see that there
  135. is not room for a third full record, so it will stop.  This stopping at the
  136. record-boundary allows you to continue the display, with correct alignment,
  137. on subsequent lines.
  138.  
  139.  
  140. Spacing Between Memory-Display Units
  141.  
  142. In general, the debugger provides a space between each unit (byte or word)
  143. it displays.  There is an exception, however: the debugger will not space
  144. between adjacent text-characters (A,C, or T specifications).
  145.  
  146. There are special specifiers G, J, and M, described in the section below,
  147. that allow you to override the debugger's spacing policies.
  148.  
  149.  
  150. Special-Action Format Specifiers
  151.  
  152. In addition to the nine letters mentioned above, that specify data types,
  153. there are 7 other letters, and 2 other characters, that cause the debugger
  154. to perform special actions.  Following is a complete description all 18
  155. non-digit characters that can occur within a format specification:
  156.  
  157. =  causes a display, using the format of the letter following =, of the
  158.    current memory pointer value, instead of the contents of the memory
  159.    location.  If a letter does not follow the =, then W is used; i.e.,
  160.    the pointer is display as a 4-digit hex word.  There are two uses for
  161.    this feature that come to mind:
  162.  
  163.    * If your address specification is symbolic, you can display the equivalent
  164.      numeric address with =w, telling you exactly where the symbol is in
  165.      memory.  Note that this display implicitly occurs at the beginning
  166.      of continuation lines.  If the format-specification begins with =, then
  167.      the implicit display is suppressed, because the same address is given
  168.      explicitly by the L.
  169.  
  170.    * You can display the values of registers in a format other than hex.  For
  171.      example, in the 8086 debugger you can display AX as a decimal number
  172.      by specifying =d1,ax on one of the memory-display lines.
  173.  
  174. @  causes the debugger to read the next byte it was going to display, and
  175.    instead of displaying the byte, use it as a count, to repeat the next
  176.    letter in the specification.  The debugger uses only the bottom 7 bits
  177.    of the memory byte for the count.  For example, of the memory contains
  178.    a length byte followed by that number of text characters, the text could
  179.    be displayed by specifying @t (or @a or @c, depending on what you want
  180.    the display to look like).  If the memory contains 05 41 42 43 44 45,
  181.    the @t would cause ABCDE to be displayed.
  182.  
  183. A  causes a display of a single ASCII byte, always using 2 display bytes.
  184.    The following table shows what is displayed for unusual bytes:
  185.  
  186.         range of N         display of N               Example
  187.         ----------         ------------               -------
  188.          00--1F            ^ followed by N+040         02 is ^B
  189.          22                ""
  190.          23                "#
  191.          24                "$
  192.          5E                "^
  193.          7F                ^r  (r stands for rubout)
  194.          80--9F            $ followed by N-080+040     081 is $A
  195.          A0--FE            # followed by N-080         0B1 is #1
  196.          FF                $r
  197.  
  198.    All other bytes cause a display of a space following by the appropriate
  199.    ASCII byte.  The A specification is used when you need guaranteed display
  200.    length for proper alignment of continuation lines; and you do not want the
  201.    potential loss of information provided by the single-byte T specification.
  202.  
  203. B  causes a display of a single byte as a 2-digit hexadecimal number.  Numbers
  204.    less than hex 10 have a leading 0, so that the display is always 2 digits.
  205.  
  206. C  causes a display of a single ASCII character, just as the A specification,
  207.    except that normal characters (not in the table) display as just one byte,
  208.    without the preceding space.
  209.  
  210. D  causes the display of a 16-bit word as an unsigned positive decimal number.
  211.    There will be no leading zeros in the display; so the length of the display
  212.    depends on the size of the number.
  213.  
  214. G  causes a gap between the adjacent display-formats, of one space more than
  215.    there would have been without the G.  For adjacent string bytes, this means
  216.    a space where there would have been none.  For other data types, this means
  217.    two spaces where there would have been one.
  218.  
  219. J  (join) causes two adjacent data types, that would have had a space between
  220.    them, to have no space.
  221.  
  222. L  (line) causes the display of an entire text line, using the C-format
  223.    for each character of the line.  The debugger does not display the
  224.    terminating carriage return; nor does it display the following linefeed if
  225.    there is one.  (If you want it to, specify LRC or LRRCC instead of L.)
  226.    If a carriage return is not found and the display line fills, then the
  227.    L-specifier is cut off in mid-string.  Any continuation line would start up
  228.    at the beginning of the format specification, at the mid-string place in
  229.    memory.
  230.  
  231. M  (mark) causes a vertical-bars output to be made.  The output will replace
  232.    a separating space that would have been output in the position.  If you want
  233.    the space, you can provide G on either side (or both sides) of the M.
  234.  
  235. N  (number) causes the display of an 8-bit byte as an unsigned positive decimal
  236.    number.  There will be no leading zeroes in the display; so the length of
  237.    the display depends on the size of the number.
  238.  
  239. O  causes a display of a 16-bit word as a 6-digit octal number.  Numbers less
  240.    than octal 100000 have one or more leading zeroes, so that the display is
  241.    always 6 digits.
  242.  
  243. Q  causes a display of a single byte as a 3-digit octal number.  Numbers less
  244.    than octal 100 have one or more leading zeroes, so that the display is
  245.    always 3 digits.
  246.  
  247. S  causes the display of an entire null-terminated string, using the C-format
  248.    for each character of the string.  The terminating null (hex 00) does not
  249.    generate a display (if you want it to, specify SRC instead of S).  If a
  250.    null is not found and the display line fills, then the S-specifier is cut
  251.    off in mid-string.  Any continuation line would start up at the beginning
  252.    of the format specification, at the mid-string place in memory.
  253.  
  254. T  causes the display of a single ASCII text byte, with a guaranteed display-
  255.    space of one character.  The character displayed is the same as the second
  256.    character of the A-format.  This means that you will not be able to tell the
  257.    difference between normal, displaying ASCII characters, and their control and
  258.    non-ASCII counterparts.  You gain a compact representation, but you also gain
  259.    ambiguity.
  260.  
  261. U  (unskip) causes the memory display pointer to decrement by one byte.   No
  262.    display is generated by this command.  This command is useful in several
  263.    contexts:
  264.  
  265.    * displaying memory in more than one format.  For example, the
  266.      specification 8b8r2g8a gives a hex-and-ASCII side-by-side display, similar
  267.      to that provided by many memory-dump programs.
  268.  
  269.    * displaying memory out of its sequence order.  To test your understanding
  270.      of the special-action letters in a format specification, you should
  271.      convince yourself that the specification xb2rjbx99/ gives the same
  272.      display on the following "-continuation line as the specification w/ does.
  273.  
  274.    * displaying the count-byte consumed by the @ character.  For example,
  275.      instead of @t, you could specify nr@t, which would display the string
  276.      count as well as the string.  If memory were 05 41 42 43 44 45, this would
  277.      be 5 ABCDE.
  278.  
  279. W  causes a display of a 16-bit word as a 4-digit hex number.  Numbers less
  280.    than hex 1000 have one or more leading zeroes, so that the display is always
  281.    4 digits.
  282.  
  283. X  causes the debugger to skip over the memory byte currently pointed to,
  284.    without displaying it.  The memory pointer is thus incremented.
  285.  
  286. Z  is given immediately following another format letter.  It causes the display
  287.    to fill out the line with displays of the given preceding format; but
  288.    instead of starting with the given address, the debugger starts with a
  289.    lower address, and displays memory up to but not including the given
  290.    address.
  291.  
  292.    The most common usage of Z is to display the memory just output by a moving
  293.    output pointer.  For example, in the 8086 debugger, you could specify
  294.    bz,es,di to display the hex bytes most recently output by the STOSB
  295.    instruction.
  296.  
  297.    Note that Z makes sense only in a limited number of contexts.  You will
  298.    almost certainly want to use Z only as the second letter of a two-letter
  299.    specification, as in the example above.  We further recommend that a
  300.    format-letter that generates a fixed-length display be used; i.e.,
  301.    B,W,Q,O,T, or C.  If you use a variable-length display (N,D, or A),
  302.    the debugger will be as pessimistic as possible about the number of
  303.    display characters needed, so that the display will likely terminate
  304.    before the end of the line.
  305.  
  306.    A continuation of a Z-line will produce the same output as the original
  307.    line.  If you want to continue beyond the address given, repeat the
  308.    specification without the Z.
  309.  
  310.    We now discuss what happens if you use Z in other contexts.  Unless your
  311.    taste runs to the bizarre, you should skip this paragraph.  Since Z
  312.    fills out a line, there should be no specifiers after Z: they would be
  313.    ignored.  Also note that Z has an effect only on the single letter that
  314.    precedes it.  If you precede Z with more than one letter, you will get a
  315.    confusing effect: the display would start out forward from the address,
  316.    then it would retreat when it got to Z's preceding letter.  The Z-array
  317.    would run up to the address reached before, which is forward from the
  318.    address you specified.
  319.  
  320.